package com.minyifang.wcspf.common.utils;
/**
 * @author xuyougen
 * @date 2018.07.10
 * 数组/集合工具
 */

import java.util.ArrayList;
import java.util.List;

public class ArrayUtil {

    public static <T> List<String> listConvertToStringList(List<T> list, StringConverter<T> converter) {
        List<String> stringList = new ArrayList<>();
        for (T t : list) {
            stringList.add(converter.convertToString(t));
        }
        return stringList;
    }

    public interface StringConverter<T> {
        String convertToString(T t);
    }
}
